package com.rk.kbk.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rk.kbk.common.DateJsonDeserializer;
import com.rk.kbk.common.DateJsonSerializer;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @Admin
 * @管理员(admin)
 * @version : Ver 1.0
 */
@Entity
public class Admin implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * @备注:
	 * @字段:id BIGINT(19)
	 */
	@Id
	@GeneratedValue(strategy= GenerationType.IDENTITY)
	@GenericGenerator(name="auto-identity",strategy="identity")
	@Column(updatable = false, columnDefinition="BIGINT(19) COMMENT ''")
	private java.lang.Long id;

	/**
	 * @备注:账号
	 * @字段:user_name VARCHAR(255)
	 */
	@Column(columnDefinition="VARCHAR(255) COMMENT '账号'")
	private java.lang.String userName;

	/**
	 * @备注:密码
	 * @字段:password VARCHAR(255)
	 */
	@Column(columnDefinition="VARCHAR(255) COMMENT '密码'")
	private java.lang.String password;

	/**
	 * @备注:昵称
	 * @字段:nick_name VARCHAR(19)
	 */
	@Column(columnDefinition="VARCHAR(19) COMMENT '昵称'")
	private java.lang.String nickName;

	/**
	 * @备注:真实姓名
	 * @字段:real_name VARCHAR(19)
	 */
	@Column(columnDefinition="VARCHAR(19) COMMENT '真实姓名'")
	private java.lang.String realName;

	/**
	 * @备注:1表示超级管理员2表示普通管理员
	 * @字段:role_type INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '1表示超级管理员2表示普通管理员'")
	private java.lang.Integer roleType;

	/**
	 * @备注:
	 * @字段:token VARCHAR(255)
	 */
	@Transient
	private java.lang.String token;

	/**
	 * @备注:默认1表示正常，2表示冻结
	 * @字段:status INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '默认1表示正常，2表示冻结'")
	private java.lang.Integer status;

	/**
	 * @备注:创建时间
	 * @字段:gmt_datetime DATETIME(19)
	 */
	@Column(updatable = false, columnDefinition="DATETIME(19) COMMENT '创建时间'")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date gmtDatetime = new java.util.Date();

	/**
	 * @备注:修改时间
	 * @字段:upt_datetime DATETIME(19)
	 */
	@Column(columnDefinition="DATETIME(19) COMMENT '修改时间'")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date uptDatetime = new java.util.Date();

	public Admin(){
	}

	public Admin(
			java.lang.Long id
	){
		this.id = id;
	}



	public void setId(java.lang.Long id) {
		this.id = id;
	}

	public java.lang.Long getId() {
		return this.id;
	}


	public void setUserName(java.lang.String userName) {
		this.userName = userName;
	}

	public java.lang.String getUserName() {
		return this.userName;
	}


	public void setPassword(java.lang.String password) {
		this.password = password;
	}

	public java.lang.String getPassword() {
		return this.password;
	}


	public void setNickName(java.lang.String nickName) {
		this.nickName = nickName;
	}

	public java.lang.String getNickName() {
		return this.nickName;
	}


	public void setRealName(java.lang.String realName) {
		this.realName = realName;
	}

	public java.lang.String getRealName() {
		return this.realName;
	}


	public void setRoleType(java.lang.Integer roleType) {
		this.roleType = roleType;
	}

	public java.lang.Integer getRoleType() {
		return this.roleType;
	}


	public void setToken(java.lang.String token) {
		this.token = token;
	}

	public java.lang.String getToken() {
		return this.token;
	}


	public void setStatus(java.lang.Integer status) {
		this.status = status;
	}

	public java.lang.Integer getStatus() {
		return this.status;
	}


	public void setGmtDatetime(java.util.Date gmtDatetime) {
		this.gmtDatetime = gmtDatetime;
	}

	public java.util.Date getGmtDatetime() {
		return this.gmtDatetime;
	}


	public void setUptDatetime(java.util.Date uptDatetime) {
		this.uptDatetime = uptDatetime;
	}

	public java.util.Date getUptDatetime() {
		return this.uptDatetime;
	}
}
